# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=4

inherit eutils multilib git-2

DESCRIPTION="libretro implementation of PCSX-ReARMed. (PlayStation)"
HOMEPAGE="https://github.com/libretro/pcsx_rearmed"
SRC_URI=""

EGIT_REPO_URI="git://github.com/libretro/pcsx_rearmed.git"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~x86 ~amd64 ~arm"
IUSE=""

REQUIRED_USE=""

RDEPEND=""

DEPEND=""

S="${WORKDIR}"

src_unpack() {
	S="${WORKDIR}" git-2_src_unpack
}

src_configure() {
        ./configure \
        --platform=libretro || die "configure failed"
}

src_compile() {
	emake	|| die "emake failed"
	mv libretro.so pcsx_rearmed-libretro.so
}

src_install() {
        exeinto /usr/$(get_libdir)/libretro
        doexe *.so || die "failed to install library"
}

pkg_postinst() {
	ewarn "You need to place BIOS files into your"
	ewarn "system_directory (see ~/.retroarch.cfg)"
	ewarn "For full functionality place scph5500.bin,"
	ewarn "scph5501.bin and scph5502.bin into it."
}